﻿using System.Collections.Generic;
using wojilu.cms.Domain;
using wojilu.Web;
using wojilu.Web.Mvc;

namespace wojilu.cms.Controller.Admin
{
    public class FrameController : ControllerBase
    {
        public FrameController()
        {
            HideLayout(typeof(LayoutController));
        }

        public void Index()
        {
            List<TopMenu> list = cdb.findAll<TopMenu>();
            IBlock block = getBlock("menu");
            foreach (TopMenu a in list)
            {
                block.Set("a.Title", strUtil.CutString(a.Name, 15));
                block.Set("lnkLeft", to(new LeftController().Show, a.Id));
                if (a.Id == 1)
                {
                    block.Set("selected", "onnav");
                }
                else
                {
                    block.Set("selected", "");
                }
                block.Next();
            }
        }

    }
}
